package com.hzdesk.media.koreabatchmatvector.logic.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.hzdesk.media.koreabatchmatvector.R;
import com.hzdesk.media.koreabatchmatvector.logic.contract.ColorPickerContract;
import com.hzdesk.media.koreabatchmatvector.logic.persenter.ColorPickerPersenter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ColorpickerActivity extends BaseActivity implements ColorPickerContract.IColorPickerView {

    @BindView(R.id.activity_color_picker_iv_back)
    ImageView activityColorPickerIvBack;
    @BindView(R.id.activity_color_picker_recyclerview)
    RecyclerView activityColorPickerRecyclerview;
    @BindView(R.id.activity_color_picker_ll_bg)
    LinearLayout activityColorPickerLlBg;

    private ColorPickerPersenter colorPickerPersenter = new ColorPickerPersenter(this);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_colorpicker);
        ButterKnife.bind(this);
        colorPickerPersenter.initView(this, getIntent(), activityColorPickerRecyclerview);
    }


    @Override
    public void onColorSelect(String color) {
        Intent intent = new Intent();
        intent.putExtra("paintColor", color);
        ColorpickerActivity.this.setResult(1, intent);
        ColorpickerActivity.this.finish();
    }

    @Override
    public void back() {
        finish();
    }

    @OnClick({R.id.activity_color_picker_iv_back, R.id.activity_color_picker_recyclerview, R.id.activity_color_picker_ll_bg})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.activity_color_picker_iv_back:
                colorPickerPersenter.onClickedBack();
                break;
            case R.id.activity_color_picker_recyclerview:
                break;
            case R.id.activity_color_picker_ll_bg:
                break;
        }
    }
}
